import Mock from 'mockjs'

const list = Mock.mock({
  'data|100-150': [{
    'id|+1': 1,
    'flowId': /^[A-Z]{3}$/,
    'tokenName': /^[A-Z]{3}$/,
    'type': 10,
    'transferAmount|1-1000.1-2': 1,
    'createTime': '@datetime',
    'balance|1000-5000.2-4': 1,
    'walletBalance|500-5000.2-4': 1,
    'phone': /^1(3|4|5|7|8)\d{9}$/,
    'walletAddress|20-30': '',
    'txHash|20-30': '',
  }]
})

const basisInfo = {
  'userId': 1,//用户ID <number>
  'phone': '1825478452',//用户手机号码 <string>
  'commitTIme': '2019-11-29 12:45:21',//提交时间 <string>
  'tokenName': 'ETH',//代币名称 <string>
  'transferAmount': '1000.32',//交易金额 <string>
  'handlingFree': '2.321',//手续费 <string>
  'realAmount': '997.679',//实际到账金额 <string>
  'status': 10//状态 -20(失败) 10(成功) <number>balance
}

export default [
  {
    url: '/admin/recharge/list',
    type: 'post',
    response: config => {
      return {
        'code': 10000,
        'responseTime': 1548489480000,
        'message': 'OK',
        "total": list.data.length,
        'data': list.data,
      }
    }
  },
  {
    url: '/admin/recharge/detail',
    type: 'post',
    response: config => {
      return {
        'code': 10000,
        'responseTime': 1548489480000,
        'message': 'OK',
        'data': {
          basisInfo,
          detail: {},
          flows: []
        }
      }
    }
  },
  {
    url: '/admin/drawout/list',
    type: 'post',
    response: config => {
      return {
        'code': 10000,
        'responseTime': 1548489480000,
        'message': 'OK',
        "total": list.data.length,
        'data': list.data,
      }
    }
  },
  {
    url: '/admin/drawout/detail',
    type: 'post',
    response: config => {
      return {
        'code': 10000,
        'responseTime': 1548489480000,
        'message': 'OK',
        'data': {
          basisInfo,
          detail: {},
          flows: []
        }
      }
    }
  },
  {
    url: '/admin/funds/list',
    type: 'post',
    response: config => {
      return {
        'code': 10000,
        'responseTime': 1548489480000,
        'message': 'OK',
        "total": list.data.length,
        'data': list.data,
      }
    }
  },
  {
    url: '/admin/funds/refresh',
    type: 'post',
    response: config => {
      return {
        'code': 10000,
        'message': 'OK'
      }
    }
  },
  {
    url: '/admin/system/modifyPassword',
    type: 'post',
    response: config => {
      return {
        'code': 10000,
        'message': 'OK'
      }
    }
  },
]
